package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    void insert(Orders orders);


    Page<OrderVO> pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);

    @Select("select count(*) from sky_take_out.orders where status=#{status}")
    Integer getSumByStatus(Integer status);
    @Select("select * from sky_take_out.orders where id=#{id}")
    Orders getById(Long id);

    void update(Orders order);

    List<Orders> getByStatusAndOrderTimeLT(Integer status, LocalDateTime orderTime);
    Double sumByMap(Map map);

    Integer getCountByMap(Map map);

    List<GoodsSalesDTO> getSaleTop10(LocalDateTime begin,LocalDateTime end);

    List<Orders> getListByMap(Map map);
}
